package leetcode.code0026;

public class Solution extends Solution0026 {

	@Override
	public int removeDuplicates(int[] nums) {
		int len = nums.length;
		if (len < 2)
			return len;
		int p1 = 1;
		int p2 = 0;
		while (p1 < len) {
			if (nums[p1] != nums[p2]) {
				p2++;
				if (p1 != p2) {
					nums[p2] = nums[p1];
				}
			}
			p1++;
		}
		return p2 + 1;
	}

	public static void main(String[] args) {
		Solution so = new Solution();
		so.debug1();
		so.debug2();
	}

}
